/*
ID: guoxu1
LANG: JAVA
TASK: sprime
*/
import java.io.*;
import java.util.*;
import java.math.*;

class sprime {
  
  static int pow( int a, int b )
  {
    int r = 1;
    for( int i = 0; i < b; i++ ) r *= 10;
    return r;
  }

  public static void main (String [] args) throws IOException {
    // Use BufferedReader rather than RandomAccessFile; it's much faster
    BufferedReader f = new BufferedReader(new FileReader( "sprime.in" )/*new InputStreamReader(System.in)*/);
                                                  // input file name goes above
    PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter( "sprime.out" )/*new OutputStreamWriter(System.out)*/));
    // Use StringTokenizer vs. readLine/split -- lots faster
    StringTokenizer st = new StringTokenizer(f.readLine());
						  // Get line, break into tokens
    int n = Integer.parseInt(st.nextToken());    // first integer
    
    ArrayList<Integer> primes = new ArrayList<Integer>();
    primes.add(2);
    primes.add(3);
    primes.add(5);
    primes.add(7);    
    
    for( int i = 1; i < n; i++ )
    {
      ArrayList<Integer> next_primes = new ArrayList<Integer>();
      for( int j = 0; j < primes.size(); j++ )
      {
        for( int k = 1; k < 10; k += 2 )
        {
          if( k == 5 ) continue;
          int v = primes.get(j) * 10 + k;
          if( BigInteger.valueOf( v ).isProbablePrime( 5 ) )
          {
            next_primes.add( v );
          }
        }
      }
      primes = next_primes;
    }
    
    for( int i = 0; i < primes.size(); i++ )
    {
      out.println( primes.get(i) );
    }
    
    
    out.close();                                  // close the output file
    System.exit(0);                               // don't omit this!
  }
}
